pub fn min_edge_prime_num(number: u32) -> String {
    let number = number as u64;
    let mut odd_count = 0;
    let mut odd_total = 1;
    let mut odd_last = 1;


    for length in 2u64.. {
        if length % 2 == 0 {
            
        } else {
            let step = length - 1;
            let i0 = odd_last + step;
            let i1 = i0 + step;
            let i2 = i1 + step;
            odd_last = i2 + step;

            for i in [i0, i1, i2] {
                if is_prime(i as i128) {
                    odd_count += 1;
                }
            }
            odd_total += 4;
            if odd_total * number > odd_count * 100 {
                return format!("{},{}", length, odd_count);
            }
        }
    }
    unreachable!()
}


fn power(mut a: i128, mut b: i128, m: i128) -> i128 {
    let mut result = 1;
    a %= m;
    while b > 0 {
        if b % 2 != 0 {
            result = (result * a) % m;
        }
        b >>= 1;
        a = (a * a) % m;
    }
    result
}

fn is_prime(n: i128) -> bool {
    if n < 2 {
        return false;
    }
    if n != 2 && n % 2 == 0 {
        return false;
    }
    let s = ((n - 1) as u128).trailing_zeros() as i128;
    let d = (n - 1) / 2i128.pow(s as u32);

    let witnesses: [i128; 6] = [2, 3, 5, 7, 11, 13];
    'next_witness: for &a in witnesses.iter().take_while(|&&x| x <= n - 1) {
        let mut x = power(a, d, n);
        if x == 1 || x == n - 1 {
            continue;
        }
        for _r in 1..s {
            x = power(x, 2, n);
            if x == n - 1 {
                continue 'next_witness;
            }
        }
        return false;
    }
    true
}
